package com.flyduck.vueshop.system.remote.controller;

import com.flyduck.vueshop.common.core.lang.Result;
import com.flyduck.vueshop.common.sotoken.annotation.InnerAuth;
import com.flyduck.vueshop.system.remote.service.RemoteRoleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * SysUserApiController
 * </p>
 *
 * @author flyduck
 * @since 2024-07-09
 */
@RestController
@RequestMapping("/system/remote/role")
public class RemoteRoleController {

    @Resource
    private RemoteRoleService remoteRoleService;

    @InnerAuth
    @GetMapping("/getRoleCodeListByUserId")
    public Result<List<String>> getRoleCodeListByUserId(@RequestParam("userId") Long userId){
        List<String> roleCodeList = remoteRoleService.getRoleCodeListByUserId(userId);
        return Result.success(roleCodeList);
    }
}
